const startHour = 7;
const endHour = 22;
const payloadHours = endHour - startHour;// 15 共有多少个小时有效执行任务

const data = new Date();
const hours = 8 || data.getHours();
const minutes = 0;
//  || data.getMinutes();// 0  /  30

if (hours === startHour && !minutes) return;

const interval = ["0.5"];//每隔半个小时执行 所以半小时任务一定符合

const diffHour = hours - startHour;

if (diffHour) {//找到能被整除的数
    // '<' 目的是少比较一次,自己肯定能被整除啦
    for (let i = minutes ? 2 : 1; i < diffHour; i++) {
        if (diffHour % i === 0) interval.push(i.toString());
    }
    !minutes && interval.push(diffHour.toString());
}
console.log(interval);